package com.lqs.dataservice.Controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lqs.dataservice.Service.MaterialService;
import com.lqs.dataservice.Service.UserService;
import com.lqs.dataservice.entity.Material;
import com.lqs.dataservice.entity.User;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * ArmyController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-27 14:45
 */
@Component
public class MaterialController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  MaterialService materialService;

  public List<Material> findAllMaterial() {
    return materialService.findAllMaterial();
  }

  public Material findMaterialById(String id) {
    return materialService.findMaterialById(id);
  }

  public Response saveMaterial(Material entity) {
    return materialService.saveMaterial(entity);
  }

  public Response deleteMaterialById(String id) {
    return materialService.deleteMaterialById(id);
  }

  public List<Material> findAllByMatParengId(String id) {
    return materialService.findAllByMatParengId(id);
  }



  }
